#import "dfhgwhruebvhrheyincidentallycomet.h"
#import "dfhgwhruebvhrheyrevolutionarycapsule.h"
@implementation dfhgwhruebvhrheyrevolutionarycapsule {
	UILabel *dateLabel;
	UILabel *date;
	UILabel *amountLabel;
	UILabel *amount;
	UILabel *principalLabel;
	UILabel *principal;
	UILabel *interestLabel;
	UILabel *interest;
}
- (instancetype)initWithFrame:(CGRect)frame {
	if(self = [super initWithFrame:frame]) {
		[self setUI];
	}
	return self;
}
- (UILabel *)generateLabelWithText:(NSString *)text withTextColor:(UIColor *)color {
	UILabel *lb = [[UILabel alloc] init];
	lb.font = [UIFont regular:15];
	lb.textColor = color;
	lb.text = text;
	return lb;
}
- (void)setUI {
	dateLabel = [self generateLabelWithText:@"Repayment Date" withTextColor:@"#3B414B".dhgfywegwygeydwlearneddesignate];
	[self addSubview:dateLabel];
	date = [self generateLabelWithText:@"" withTextColor:@"#3B414B".dhgfywegwygeydwlearneddesignate];
	[self addSubview:date];
	amountLabel = [self generateLabelWithText:@"Repayment Amount" withTextColor:@"#3B414B".dhgfywegwygeydwlearneddesignate];
	[self addSubview:amountLabel];
	amount = [self generateLabelWithText:@"" withTextColor:@"#3B414B".dhgfywegwygeydwlearneddesignate];
	[self addSubview:amount];
	principalLabel = [self generateLabelWithText:@"Principal" withTextColor:@"#3B414B".dhgfywegwygeydwlearneddesignate];
	[self addSubview:principalLabel];
	principal = [self generateLabelWithText:@"" withTextColor:@"#3B414B".dhgfywegwygeydwlearneddesignate];
	[self addSubview:principal];
	interestLabel = [self generateLabelWithText:@"Interest" withTextColor:@"#3B414B".dhgfywegwygeydwlearneddesignate];
	[self addSubview:interestLabel];
	interest = [self generateLabelWithText:@"" withTextColor:@"#3B414B".dhgfywegwygeydwlearneddesignate];
	[self addSubview:interest];
	self.backgroundColor = [UIColor whiteColor];
}
- (void)bindData:(dhgfywegwygeydwbulletinalter *)replayModel {
	date.text = replayModel.back_time;
	NSString *amountString = [NSString stringWithFormat:@"%d",replayModel.repay_price].dhgfywegwygeydwlocalitylearned;
	amount.text = [NSString stringWithFormat:@"PHP %@", amountString];
	NSString *principalString = [NSString stringWithFormat:@"%d",replayModel.principal].dhgfywegwygeydwlocalitylearned;
	principal.text = [NSString stringWithFormat:@"PHP %@", principalString];
	NSString *interestString = [NSString stringWithFormat:@"%d",replayModel.interest].dhgfywegwygeydwlocalitylearned;
	interest.text = [NSString stringWithFormat:@"PHP %@", interestString];
}
- (void)layoutSubviews {
	[super layoutSubviews];
	[dateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
		make.top.left.equalTo(self).offset(10);
		make.height.mas_equalTo(20);
	}];
	[date mas_makeConstraints:^(MASConstraintMaker *make) {
		make.right.equalTo(self).offset(-10);
		make.centerY.equalTo(dateLabel);
		make.height.mas_equalTo(20);
	}];
	[amountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
		make.top.equalTo(dateLabel.mas_bottom).offset(10);
		make.left.equalTo(dateLabel);
		make.height.mas_equalTo(20);
	}];
	[amount mas_makeConstraints:^(MASConstraintMaker *make) {
		make.centerY.equalTo(amountLabel);
		make.right.equalTo(date);
		make.height.mas_equalTo(20);
	}];
	[principalLabel mas_makeConstraints:^(MASConstraintMaker *make) {
		make.top.equalTo(amountLabel.mas_bottom).offset(10);
		make.left.equalTo(amountLabel);
		make.height.mas_equalTo(20);
	}];
	[principal mas_makeConstraints:^(MASConstraintMaker *make) {
		make.centerY.equalTo(principalLabel);
		make.right.equalTo(amount);
		make.height.mas_equalTo(20);
	}];
	[interestLabel mas_makeConstraints:^(MASConstraintMaker *make) {
		make.top.equalTo(principalLabel.mas_bottom).offset(10);
		make.left.equalTo(principalLabel);
		make.height.mas_equalTo(20);
		make.bottom.equalTo(self).offset(-10);
	}];
	[interest mas_makeConstraints:^(MASConstraintMaker *make) {
		make.centerY.equalTo(interestLabel);
		make.right.equalTo(principal);
		make.height.mas_equalTo(20);
	}];
}
@end
